.<template>
  <div class="cbl">
    <el-row>
      <el-col :span="24">
        <h5>小U商城后台</h5>
        <!-- router开启路由模式 -->
        <el-menu
        unique-opened
        :default-active="$route.path"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
          router
        >
<<<<<<< HEAD
          <el-menu-item index="/">
=======
<<<<<<< HEAD
          <el-menu-item index="/">
=======
          <el-menu-item index="/index">
>>>>>>> d519b3a9147c56fc3b4298a9549da21438cdf484
>>>>>>> bab7c7a15a7723f417b1c3b2179ae51ae1f154c9
            <i class="el-icon-setting"></i>
            <span slot="title">首页</span>
          </el-menu-item>
          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-setting"></i>
              <span>系统设置</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="/menu">菜单管理</el-menu-item>
              <el-menu-item index="/role">角色管理</el-menu-item>
              <el-menu-item index="/admin">管理员管理</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-s-goods"></i>
              <span>商城管理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item  
              v-for="(item,index) in menuList"
              :key="index"
              :index="item.path"
              >{{item.title}}</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {
      menuList:[
        { title:'商品分类',path:'category'},
        { title:'商品规格',path:'specs'},
        { title:'商品管理',path:'goods'},
        { title:'会员管理',path:'member'},
      ]
    };
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
  },
};
</script>

<style>
  .el-menu-vertical-demo{
    text-align: left;
  }
  .el-menu-item.is-active{
    background-color: #FB6D49!important;
  }
   .el-menu-item.is-active i,
  .el-menu-item.is-active span{
    color: #fff;
  }
  .cbl h5{
  
    height: 60px;
    background-color: #444444;
    font:bold 28px/60px '微软雅黑';
    color: #FFFFFF;
  }
  .el-aside{
    /* background-color: red; */
  }
  .el-col-24{
    background-color: red;
   width: 278px!important;
   
  }
  .el-aside{
      width: 278px!important;
  }
  
</style>